package com.fr.report.script.core.parser;

import com.fr.base.ColumnRow;
import com.fr.report.script.Calculator;

public class CRAddress extends Tiny
{
  private ColumnRow target;

  CRAddress(ColumnRow paramColumnRow)
  {
    this.target = paramColumnRow;
  }

  public ColumnRow getTarget()
  {
    return this.target;
  }

  public Object eval(Calculator paramCalculator)
    throws UtilEvalError
  {
    return paramCalculator.resolveVariable(this);
  }

  public String toString()
  {
    return "&" + this.target;
  }

  public String getExpression(int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean)
  {
    int i = this.target.getColumn();
    if ((paramInt3 != -1) && (this.target.getColumn() >= paramInt3))
      i += paramInt4;
    int j = this.target.getRow();
    if ((paramInt1 != -1) && (this.target.getRow() >= paramInt1))
      j += paramInt2;
    return "&" + ColumnRow.valueOf(i, j).toString();
  }

  public String[] parserParameter()
  {
    return new String[] { new String(this.target.toString()) };
  }
}